<?php
   session_start();
    
    $cdoi = $_REQUEST['coddi'];
    $code = $_REQUEST['codde'];
    
    include_once '../../../../controlador/php/conexion/Conexion10.php';
    $con10 = new Conexion10();
    $oidi= "SELECT OID FROM  ".$con->getReal()."..GENDIAGNO 
            WHERE DIACODIGO = '".$cdoi."'";
    $lsti = $con10->query($oidi);
    
    while ($lsti2 = mssql_fetch_array($lsti)){
        $oi = $lsti2['OID'];
    }
    
    
    $oide= "SELECT OID FROM  ".$con->getReal()."..GENDIAGNO 
            WHERE DIACODIGO = '".$code."'";
    $lste = $con10->query($oide);
    
    while ($lste2 = mssql_fetch_array($lste)){
        $oe =$lste2['OID'];
    }
    
    $con10->cerrarConexion();
    
    
    $ingresos = $_REQUEST['cbIngresos'];
    $procedencia = $_REQUEST['cbProcedencia'];
    $conducta = $_REQUEST['cbConducta'];
    $estado = $_REQUEST['cbEstadoA'];
    $ftp = $_REQUEST['formaTermP'];
    $fechap = $_REQUEST['txtFechaP'];
    $hora = $_REQUEST['hora'];
    $minuto = $_REQUEST['minutos'];
    $analgesia = $_REQUEST['cbAnalgO'];
    $cauna = $_REQUEST['caunanalgesia'];
    $medico = $_REQUEST['medico'];  
    $oid = $_REQUEST['oid'];
    $horap = $hora.":".$minuto;
    
    $di = $_REQUEST['txtDi'];
    $de = $_REQUEST['txtDe'];
    
    include_once '../../../../controlador/php/conexion/Conexion.php';
    $con = new Conexion();
    
    $update = "update atenMaterna
               set adnIngreso = ".$ingresos.",  
                   ate_procede = '".$procedencia."',
                   ate_conducta = '".$conducta."',
                   ate_diagIngreso = '".$di."',
                   ate_diagEgreso = '".$de."',
                   diagIngreso = '".$oi."',
                   diagEgreso = '".$oe."',
                   usu_oid = ".$_SESSION['usuario']."
               where genPacien =".$oid;
    $con->query($update);
    
    header("location:../../../vista/php/exitoEdis.php");
    $con->cerrarConexion();

    
?>